<template>
  <BasicDrawer @register="register">
    <MonacoEditor
      ref="monaco"
      v-model:value="result"
      language="json"
      style="{ height: 500px }"
      :auto-format="true"
    />
  </BasicDrawer>
</template>
<script setup>
import { ref } from 'vue';
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
import { MonacoEditor } from '@/components/Monaco';
const emit = defineEmits(['success', 'register']);
const monaco = ref();
const [register, { closeDrawer }] = useDrawerInner(async (data) => {
  result.value = JSON.stringify(data);
  setTimeout(() => {
    console.log(monaco.value, 'vaou');
  }, 1000);
});

const result = ref('');
</script>
<style lang="less">
.scroll-container .scrollbar__view {
  height: 100% !important;
  box-sizing: border-box;
  > div {
    height: 100% !important;
  }
}
</style>